import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/api/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/api/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/api/user/logout',
    method: 'post',
  })
}

export function register(data) {
  return request({
    url: '/api/user/register',
    method: 'post',
    data
  })
}

export function getUserInfo(data) {
  return request({
    url: '/api/user/getInfo',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    url: '/api/user/update',
    method: 'post',
    data
  })
}

export function getUserId(data) {
  return request({
    url: '/api/user/getUserId',
    method: 'post',
    data
  })
}
export function uploadAvatar(data) {
  return request({
    url: '/api/user/uploadUserAvatar',
    method: 'post',
    data
  })
}

//邮箱验证码
export function sendVerifyCode(data) {
  return request({
    url: '/api/mail/sendSimpleMail',
    method: 'post',
    data
  })
}

//邮箱图片
export function sendImageMail(data) {
  return request({
    url: '/api/mail/sendImageMail',
    method: 'post',
    data
  })
}